Post-process Javascript

Arguments

htmlstring

The HTML that will be displayed.

Description

Fires after the HTML has been generated for the ViewBox control but before it is rendered in the browser.

Discussion

The Post-process Javascript event can be used to perform additional processing of the HTML that will be rendered for the ViewBox control before it is displayed in the browser. The JavaScript in the event can reference the html parameter, which contains the HTML that will be displayed.

If the ViewBox is configured to have multiple layouts, the Post-process Javascript property is hidden on the ViewBox Properties tab and exposed on the Multiple Layouts tab so that you can define separate post-processing rules for each ViewBox layout.

Example: Text Highlighting

The Post-process Javascript event can be used to add Text Highlighting to the HTML in the ViewBox control. For example, the following will add text highlighting to the text in the HTML that matches the phrase "ou":

return A5.u.html.highlight(html,"ou");

Example: Highlighting with Span Tags

The Post-process Javascript event can also be used to insert span tags to add custom highlighting. In this example, a span tag with in-line styles is added around the strings "name" and "address":

var before = '<span style="color:blue;">';
var after = '</span>'
var match = ['name','address'];

return A5.u.html.highlight(html,match,before,after);